#ifndef _ANIMATION_H
#define _ANIMATION_H

#include "../Math/CMath.h"
#include "../../Define/Defines.h"
#include "../OpenGLES/GLESLib.h"
#include "../SOIL/SOIL.h"

#define		_LEFT								(1<<0)
#define		_RIGHT								(1<<1)
#define		_HCENTER							(1<<2)
#define		_TOP								(1<<3)
#define		_BOTTOM								(1<<4)
#define		_VCENTER							(1<<5)
//image type
#define		_IMAGE_TYPE_CHICKEN			0
#define		_IMAGE_TYPE_DUCK			1
#define		_IMAGE_TYPE_GEESE			2
#define		_IMAGE_TYPE_EGG				3
#define		_IMAGE_TYPE_SHIT			4
#define		_IMAGE_TYPE_BASKET			5


class CSprite
{
public:
	
	INT32*	 		_texture_image_w;
	INT32*	 		_texture_image_h;

	int			_type;

	INT32			_texture_image;
	BYTE*			_texture_image_data;

	GLuint			_textures[6];
	static float* 	_uv;
	static UNICHAR* _uni_buffer;
	static char*	_ansi_buffer;

public:

	CSprite();
	~CSprite();

	//void Load(BYTE type, INT32 offset, bool is_create_texture = true);
	void Load(bool is_create_texture = true, bool linear_texture = true, INT8 palette_mask = 1);
	void Unload();

	//draw
	void DrawTexture(GLESLib* g, int texType, float x, float y, INT32 transform = 0, INT32 opacity = 100, INT8 palette = -1);

	GLuint CreateTextureImage(INT32 tex_id, UINT8* argb, INT32 w, INT32 h, bool linear_texture = true, INT8 pal = 0);
	
};
#endif